#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
struct student{
    int cj;
    char name[20];
};
int compare (const void *c,const void *d){
    return -1*(((struct student *)c)->cj-((struct student *)d)->cj);
}
char a[200][200];
int main(){ 
    int n;
    scanf("%d",&n);
    getchar();
    for(int i=1;i<=n;i++){
        fgets(a[i],sizeof(a[i]),stdin);
        a[i][strcspn(a[i],"\n")]='\0';
    }
    for(int i=1;i<n;i++){
        if(strcmp(a[i],a[i+1])){
            char temp[200];
            strcpy(temp,a[i]);
            strcpy(a[i],a[i+1]);
            strcpy(a[i+1],temp);
        }
    }
    printf("%s",a[n]);
    return 0;
}